package com.hj.saapp.common.utils;

import com.hj.saapp.BCDApplication;
import com.hj.saapp.bean.DaoMaster;
import com.hj.saapp.bean.DaoSession;


/**
 * Created by "丁永泽" on 2016/10/25.
 */

public class DBUtils {
    public  static  DBUtils dbUtils;
    public  static String dbName = "hj";
    public  static DaoSession daoSession = null;
    public static DBUtils getDBUtils() {

        if (dbUtils == null) {
            dbUtils = new DBUtils();
            DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(BCDApplication.getApp(), dbName, null);
            DaoMaster daoMaster = new DaoMaster(devOpenHelper.getWritableDatabase());
            daoSession = daoMaster.newSession();
        }
        return dbUtils;
    }






}
